Optimal. Leaf size=12 \[ -a \csc (x)-b \tanh ^{-1}(\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0333175, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3089, 3770, 2606, 8} \[ -a \csc (x)-b \tanh ^{-1}(\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3089
Rule 3770
Rule 2606
Rule 8
Rubi steps
\begin{align*} \int \csc ^2(x) (a \cos (x)+b \sin (x)) \, dx &=\int (b \csc (x)+a \cot (x) \csc (x)) \, dx\\ &=a \int \cot (x) \csc (x) \, dx+b \int \csc (x) \, dx\\ &=-b \tanh ^{-1}(\cos (x))-a \operatorname{Subst}(\int 1 \, dx,x,\csc (x))\\ &=-b \tanh ^{-1}(\cos (x))-a \csc (x)\\ \end{align*}
Mathematica [B] time = 0.0067673, size = 25, normalized size = 2.08 \[ -a \csc (x)+b \log \left (\sin \left (\frac{x}{2}\right )\right )-b \log \left (\cos \left (\frac{x}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.037, size = 19, normalized size = 1.6 \begin{align*} -{\frac{a}{\sin \left ( x \right ) }}+b\ln \left ( -\cot \left ( x \right ) +\csc \left ( x \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.10404, size = 32, normalized size = 2.67 \begin{align*} -\frac{1}{2} \, b{\left (\log \left (\cos \left (x\right ) + 1\right ) - \log \left (\cos \left (x\right ) - 1\right )\right )} - \frac{a}{\sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.490314, size = 116, normalized size = 9.67 \begin{align*} -\frac{b \log \left (\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) \sin \left (x\right ) - b \log \left (-\frac{1}{2} \, \cos \left (x\right ) + \frac{1}{2}\right ) \sin \left (x\right ) + 2 \, a}{2 \, \sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.85581, size = 24, normalized size = 2. \begin{align*} - \frac{a}{\sin{\left (x \right )}} + \frac{b \log{\left (\cos{\left (x \right )} - 1 \right )}}{2} - \frac{b \log{\left (\cos{\left (x \right )} + 1 \right )}}{2} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.14332, size = 45, normalized size = 3.75 \begin{align*} b \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right ) - \frac{1}{2} \, a \tan \left (\frac{1}{2} \, x\right ) - \frac{2 \, b \tan \left (\frac{1}{2} \, x\right ) + a}{2 \, \tan \left (\frac{1}{2} \, x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]